package jssia.database.verification;

import java.util.Arrays;

import jssia.database.mysql.constants.IndexStructure;
import jssia.database.mysql.constants.IndexType;

class IndexSchema {

    private final String name;
    private final IndexType type;
    private final IndexStructure structure;
    private final String[] columns;

    public IndexSchema(String name, IndexType type, IndexStructure indexStructure, String[] columns) {
        this.name = name;
        this.type = type;
        this.structure = indexStructure;
        this.columns = columns;
    }

    public String getName() {
        return name;
    }

    public IndexType getType() {
        return type;
    }

    public IndexStructure getStructure() {
        return structure;
    }

    public String[] getColumns() {
        return columns;
    }

    @Override
    public String toString() {
        StringBuilder builder = new StringBuilder();
        builder.append("Index [name=").append(name).append(", type=")
                .append(type).append(", structure=")
                .append(structure).append(", columns=")
                .append(Arrays.toString(columns)).append("]");
        return builder.toString();
    }

}
